﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace jogoLudumdare
{
    class Instrucoes : State
    {
        private Background creditsBG1;
        private KeyboardState keyNow;
        private MouseState mouseNow;
        Texture2D TelainstPORT1, TelainstING1, VoltarPORT, VoltarING, TEXproximo;
        Itens BtVoltar, proximo;

        public Instrucoes(ContentManager content)
        {
            VoltarING = content.Load<Texture2D>(@"TelasMenu\Ingles\bot+úo-Back");
            VoltarPORT = content.Load<Texture2D>(@"TelasMenu\Portugues\bot+úo-Voltar");
            TelainstPORT1 = content.Load<Texture2D>(@"TelasMenu\Portugues\Instrucoes_1");
            
            TelainstING1 = content.Load<Texture2D>(@"TelasMenu\Ingles\instrucoes_en");
           
            creditsBG1 = new Background(TelainstING1, new Rectangle(0, 0, 800, 600));
          
            BtVoltar = new Itens(VoltarING, new Vector2(20, 700));
            TEXproximo = content.Load<Texture2D>("proximo");
            proximo = new Itens(VoltarING, new Vector2(650, 700));
        }

        public void Update(GameTime gameTime)
        {
            keyNow = Keyboard.GetState();
            mouseNow = Mouse.GetState();

            if (Game1.IdiomaAtual == Game1.EstadoIdioma.Ingles)
            {
                creditsBG1.texture = TelainstING1;
                
            }
            if (Game1.IdiomaAtual == Game1.EstadoIdioma.Portugues)
            {
                creditsBG1.texture = TelainstPORT1;
              
            }

            if (keyNow.IsKeyDown(Keys.Enter))
            //mouseNow.LeftButton == ButtonState.Pressed ||
            //mouseNow.RightButton == ButtonState.Pressed)
            {
                nextState = GameState.Controles;
            }
        }
        public void Draw(SpriteBatch spriteBatch, MouseState mouse)
        {
            spriteBatch.Draw(creditsBG1.texture, creditsBG1.rectanglePicture, Color.White);           
            spriteBatch.Draw(proximo.Imagem, proximo.Posicao, Color.White);
            spriteBatch.Draw(BtVoltar.Imagem, BtVoltar.Posicao, Color.White);
            

        }

        public void MouseClicou(MouseState mouse)
        {
            if (mouse.X > BtVoltar.Posicao.X && BtVoltar.Posicao.X < BtVoltar.Posicao.X + BtVoltar.Posicao.Width &&
                mouse.Y > BtVoltar.Posicao.Y && mouse.Y < BtVoltar.Posicao.Y + BtVoltar.Posicao.Height)
            {
                nextState = GameState.Menu;
            }

            if (mouse.X > proximo.Posicao.X && proximo.Posicao.X < proximo.Posicao.X + proximo.Posicao.Width &&
               mouse.Y > proximo.Posicao.Y && mouse.Y < proximo.Posicao.Y + proximo.Posicao.Height)
            {
                nextState = GameState.Controles;
            }
        }


    }
}
